package com.wukaige.order.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

import java.math.BigDecimal;
import java.time.LocalDate;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author wukaige
 * @since 2021-05-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("orders")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @TableId(value = "oid", type = IdType.ASSIGN_ID)
    private String oid;

    /**
     * 收货人
     */
    @TableField("oname")
    private String oname;

    /**
     * 手机号
     */
    @TableField("ophone")
    private String ophone;


    /**
     * 下单时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("cretime")
    private Date cretime;

    /**
     * 用户id
     */
    @TableField("uid")
    private Integer uid;

    /**
     * 订单状态
     */
    @TableField("status")
    private Integer status;

    /**
     * 商品总价
     */
    @TableField("gsum")
    private BigDecimal gsum;

    /**
     * 收货地址
     */
    @TableField("address")
    private String address;

    /**
     * 商品数量
     */
    @TableField(exist = false)
    private String gnumber;

    /**
     * 商品名称
     */
    @TableField(exist = false)
    private String gname;

    /**
     * 商品颜色
     */
    @TableField(exist = false)
    private String color;


    /**
     * 中间表中商品id
     */
    @TableField(exist = false)
    private List<Ordergoods> detail;


    @TableField(exist = false)
    private String uuid;


    @TableField(exist = false)
    private String uname;

    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public String getOname() {
        return oname;
    }

    public void setOname(String oname) {
        this.oname = oname;
    }

    public String getOphone() {
        return ophone;
    }

    public void setOphone(String ophone) {
        this.ophone = ophone;
    }

    public Date getCretime() {
        return cretime;
    }

    public void setCretime(Date cretime) {
        this.cretime = cretime;
    }

    public String getGnumber() {
        return gnumber;
    }

    public void setGnumber(String gnumber) {
        this.gnumber = gnumber;
    }

    public String getGname() {
        return gname;
    }

    public void setGname(String gname) {
        this.gname = gname;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public BigDecimal getGsum() {
        return gsum;
    }

    public void setGsum(BigDecimal gsum) {
        this.gsum = gsum;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public List<Ordergoods> getDetail() {
        return detail;
    }

    public void setDetail(List<Ordergoods> detail) {
        this.detail = detail;
    }
}
